<template>
  <common-edit-dialog title="维度分析" :visible="isAnalysisDialog" @submit="confirmAnalysis"
                      @cancel="isAnalysisDialog = false">
    <common-editor :height="434" v-model="analysis"></common-editor>
  </common-edit-dialog>
</template>

<script>
import CommonEditor from '@/components/CommonEditor'

export default {
  name: 'AnalysisDialog',
  components: {
    CommonEditor
  },
  props: {
    value: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      analysis: '',
      isAnalysisDialog: false
    }
  },
  watch: {
    'value': function() {
      this.assignment()
    }
  },
  methods: {
    show() {
      this.isAnalysisDialog = true
    },
    assignment() {
      this.analysis = this.value
    },
    confirmAnalysis() {
      this.$emit('change', this.analysis)
      this.isAnalysisDialog = false
    }

  },
  mounted() {
    this.assignment()
  }
}
</script>

<style scoped lang="scss">

</style>
